package calorie.com.calorie.activity;


import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.lxh.baselibray.base.XActivity;

import butterknife.BindView;
import calorie.com.calorie.R;

public class WebViewActivity extends XActivity {
    @BindView(R.id.web)
   public WebView web;
    @Override
    public void initData(Bundle savedInstanceState) {
        String str =  getIntent().getStringExtra("url");
        web.loadUrl(str);
        web.getSettings().setJavaScriptEnabled(true);
        web.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });


    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_web_view;
    }
}
